package com.igeek.ch02.dao;

import com.igeek.ch02.entity.User;
import com.igeek.ch02.utils.JDBCUtilsByC3P0;

import java.sql.SQLException;

/**
 * @author chenmin
 * 2023/7/25 19:33
 * @description TODO
 */
public class UserDao extends BaseDao<User>{

    //通过姓名和地址查询用户信息
    public User findOne(String username , String address) throws SQLException {
        String sql = "select * from user where username = ? and address = ?";
        User user = this.selectOne(JDBCUtilsByC3P0.getConn(), sql, User.class, username, address);
        return user;
    }

}
